import React, { Component } from 'react'

export default class Child1 extends Component {
  state = {
    title: '我是一个子组件'
  }

  componentDidMount(){
    setTimeout(() => {
      this.props.setCount()
    }, 3000);
  }

  render() {
    return (
      <div>
        {this.state.title}
      </div>
    )
  }

  setTitle() {
    this.setState({
      title: 'aaabbccc'
    })
  }

}
